package com.example.micro.provider.service.impl;

import com.example.micro.provider.domain.User;
import com.example.micro.provider.mapper.UserMapper;
import com.example.micro.provider.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

//尽量使用名称注入，类型注入有性能损耗
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired(required = false)
    private UserMapper userMapper;

    @Override
    public User queryUserById(Integer id) {
        return userMapper.selectByPrimaryKey(id);
    }
}
